﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using NCLCustomerManagement.DataTransferObjects.Sale;

namespace NCLCustomerManagement.UI.Models
{
    public class SaleModel : SaleDTO
    {
        [Key]
        public new int Key
        {
            get
            {
                return base.Key;
            }
        }
        public decimal TotalValue
        {
            get
            {
                return ((decimal)base.Quantity * base.UnitPrice) + TaxValue - Discount;
            }
        }
        private decimal TaxValue
        {
            get
            {
                return (decimal)(Tax / 100) * (decimal)Quantity * UnitPrice;
            }
        }

        public DateTime ExpireUsedDate
        {
            get
            {
                return this.SaleDate.AddDays(this.AvailableDayUsed);
            }
        }

    }
}